export function wait<T>(
  ms: number = 2000,
  value?: T,
  shouldReject = false
): Promise<T> {
  return new Promise((resolve, reject) => {
    setTimeout(() => {
      shouldReject ? reject(value) : resolve(value as T);
    }, ms);
  });
}
